In a variety of applications, data produced by multiple parallel threads (also referred to as producers or data producers) are serialized and consumed (processed or logged) by a single thread (also referred to as a consumer or data consumer).
An example of such an application is a real-time performance monitor collecting variable-length data from multiple sensors (or intercepts) installed in target threads. For example, the target threads are the threads that produce a stream of data (i.e., producers) to be monitored. A monitoring software tool (“monitor” or consumer) installs sensors (i.e., intercepts) into the desired places in the code execution path of the producers. The sensors see the data and make the data available to the monitor. In another example, the target threads produce streams of data from some sources (e.g., measuring devices) to be consumed by a recording device (i.e., a consumer). The variable-length data are serialized at some point before they are externalized by a logger. A consumer performs a serialization phase of the logger so that the data is pushed in a sequence, record by record, thru a single thread before being externalized (e.g., written to an external medium). Thus, the consumer is a single thread that performs serialization.